<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/%E5%8D%9A%E5%AE%A2.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/%E5%8D%9A%E5%AE%A2.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/%E5%8D%9A%E5%AE%A2.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="杂七乱八," />





  <link rel="alternate" href="/atom.xml" title="Createsequence's Blog" type="application/atom+xml" />






<meta name="description" content="概述 最早之前博客一直是用有道云笔记写的，后面接触了 markdown 后改用 Typora 方便了不少，但是上传的时候图片仍然还要另外上传，着实麻烦。于是决定用七牛云自己搭一个图床。 一、创建并上传文件到存储空间 1.注册七牛账号，并且实名认证 2.创建储存空间 打开侧边栏，选择对象存储  选择新建空间   存储空间名称：按规则随便取 存储区域：选择离靠近的地区 访问控制">
<meta property="og:type" content="article">
<meta property="og:title" content="Typora使用七牛云图床">
<meta property="og:url" content="http://blog.xiajibagao.top/2020/06/04/%E6%9D%82%E4%B8%83%E4%B9%B1%E5%85%AB/Typora%E4%BD%BF%E7%94%A8%E4%B8%83%E7%89%9B%E4%BA%91%E5%9B%BE%E5%BA%8A/index.html">
<meta property="og:site_name" content="Createsequence&#39;s Blog">
<meta property="og:description" content="概述 最早之前博客一直是用有道云笔记写的，后面接触了 markdown 后改用 Typora 方便了不少，但是上传的时候图片仍然还要另外上传，着实麻烦。于是决定用七牛云自己搭一个图床。 一、创建并上传文件到存储空间 1.注册七牛账号，并且实名认证 2.创建储存空间 打开侧边栏，选择对象存储  选择新建空间   存储空间名称：按规则随便取 存储区域：选择离靠近的地区 访问控制">
<meta property="og:locale">
<meta property="og:image" content="http://img.xiajibagao.top/20200604140435.png">
<meta property="og:image" content="http://img.xiajibagao.top/20200604141608.png">
<meta property="og:image" content="http://img.xiajibagao.top/20200604141529.png">
<meta property="og:image" content="http://img.xiajibagao.top/20200604140440.png">
<meta property="og:image" content="http://img.xiajibagao.top/20200604141616.png">
<meta property="og:image" content="http://img.xiajibagao.top/20200604141622.png">
<meta property="og:image" content="http://img.xiajibagao.top/20200604140441.png">
<meta property="og:image" content="http://img.xiajibagao.top/20200604141627.png">
<meta property="og:image" content="http://img.xiajibagao.top/20200604141630.png">
<meta property="og:image" content="http://img.xiajibagao.top/20200604141634.png">
<meta property="og:image" content="http://img.xiajibagao.top/20200604141636.png">
<meta property="og:image" content="http://img.xiajibagao.top/20200604141547.png">
<meta property="og:image" content="http://img.xiajibagao.top/20200604140447.png">
<meta property="og:image" content="http://img.xiajibagao.top/20200604140448.png">
<meta property="article:published_time" content="2020-06-03T16:00:00.000Z">
<meta property="article:modified_time" content="2020-10-27T01:07:29.234Z">
<meta property="article:author" content="Createsequence">
<meta property="article:tag" content="杂七乱八">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://img.xiajibagao.top/20200604140435.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://blog.xiajibagao.top/2020/06/04/杂七乱八/Typora使用七牛云图床/"/>





  <title>Typora使用七牛云图床 | Createsequence's Blog</title>
  








<meta name="generator" content="Hexo 5.2.0"></head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Createsequence's Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">一个努力前进的程序猿</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off"
             placeholder="搜索..." spellcheck="false"
             type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://blog.xiajibagao.top/2020/06/04/%E6%9D%82%E4%B8%83%E4%B9%B1%E5%85%AB/Typora%E4%BD%BF%E7%94%A8%E4%B8%83%E7%89%9B%E4%BA%91%E5%9B%BE%E5%BA%8A/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/Createsequence.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Createsequence's Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Typora使用七牛云图床</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2020-06-04T00:00:00+08:00">
                2020-06-04
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E6%9D%82%E4%B8%83%E4%B9%B1%E5%85%AB/" itemprop="url" rel="index">
                    <span itemprop="name">杂七乱八</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  1.3k
                </span>
              

              

              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="概述">概述</h2>
<p>最早之前博客一直是用有道云笔记写的，后面接触了 markdown 后改用 Typora 方便了不少，但是上传的时候图片仍然还要另外上传，着实麻烦。于是决定用七牛云自己搭一个图床。</p>
<h2 id="一-创建并上传文件到存储空间">一、创建并上传文件到存储空间</h2>
<h3 id="1注册七牛账号并且实名认证">1.注册七牛账号，并且实名认证</h3>
<h3 id="2创建储存空间">2.创建储存空间</h3>
<p>打开侧边栏，选择对象存储</p>
<p><img src="http://img.xiajibagao.top/20200604140435.png"></p>
<p>选择新建空间</p>
<p><img src="http://img.xiajibagao.top/20200604141608.png"></p>
<ul>
<li>存储空间名称：按规则随便取</li>
<li>存储区域：选择离靠近的地区</li>
<li>访问控制：选择<strong>公开</strong>，否则<strong>外网无法访问，没法作为图床</strong></li>
</ul>
<h3 id="3上传文件">3.上传文件</h3>
<figure>
<img src="http://img.xiajibagao.top/20200604141529.png" alt="image-20200604115247758"><figcaption aria-hidden="true">image-20200604115247758</figcaption>
</figure>
<ul>
<li><p>选择文件管理，点击上传文件即可上传</p></li>
<li><p>不绑定私有域名时默认外链域名即为官方分配的30天有效临时域名，</p>
<p>如果绑定私有域名可以选择私有域名</p></li>
<li><p>点击详情即可预览图片</p></li>
<li><p>点击更多，选中复制外链即可获得图片外链</p>
<p><img src="http://img.xiajibagao.top/20200604140440.png"></p></li>
</ul>
<p>获取外链之后直接输入浏览器网址栏，或者在代码里引用就行了！</p>
<h2 id="二-创建二级域名并解析到七牛云cname">二、创建二级域名并解析到七牛云CNAME</h2>
<p>七牛云默认会每隔30天重新分配一个临时的测试域名，也就是说，过了30天域名重置以后，之前的外链就全部失效，为了预防这种情况，我们需要绑定一个自己的私人域名。</p>
<p>如果没有私人域名的话参考这个方案：</p>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/qinglianchen0851/article/details/84257005">七牛：测试域名过期？自己域名又没备案？这里有一招完美解决你烦恼</a></p>
<p>如果有的话可以继续往下看</p>
<h3 id="1设置存储空间域名绑定">1.设置存储空间域名绑定</h3>
<p><img src="http://img.xiajibagao.top/20200604141616.png"></p>
<ul>
<li><p>选择自定义域名，添加一条你要绑定的子域名，其他设置不需要动，添加完保存即可</p>
<p>子域名格式需要为：主机记录.域名，比如<code>img.xxxxx.com</code>这样</p></li>
<li><p>配置完成后鼠标移至CNAME按钮上，复制<code>CNAME</code></p>
<p>比如我的配置就是<code>img-xxxxx-top-idvc2rp.qiniudns.com</code></p></li>
</ul>
<h3 id="2前往域名服务商创建二级域名">2.前往域名服务商创建二级域名</h3>
<p>以阿里云为例：</p>
<p>进入控制台打开侧边栏 --》选择域名解析 --》选择要创建二级域名的根域名 --》 解析设置</p>
<figure>
<img src="http://img.xiajibagao.top/20200604141622.png" alt="image-20200604133425532"><figcaption aria-hidden="true">image-20200604133425532</figcaption>
</figure>
<p>进入解析设置后选择添加记录以创建二级域名</p>
<p><img src="http://img.xiajibagao.top/20200604140441.png"></p>
<ul>
<li><p>记录类型，创建子域名，类型选择<code>CNAME</code>，</p>
<p>因为之后图床会绑定子域名，需要直接将子域名解析到图床去</p></li>
<li><p>主机记录：即二级域名，之前存储仓库填什么这里就填什么</p>
<p>比如之前如果填的<code>img.xxxx.com</code>，这里主机记录就填<code>img</code></p></li>
<li><p>记录值：这里直接黏贴之前存储仓库复制的CNAME</p></li>
</ul>
<h3 id="3使用二级域名代替默认测试域名">3.使用二级域名代替默认测试域名</h3>
<p>先测试看看是否已经解析成功：</p>
<p>打开cmd，然后输入<code>nslookup 二级域名</code>，看看第一条是否解析到配置的CNAME值</p>
<p><img src="http://img.xiajibagao.top/20200604141627.png"></p>
<p>如果有说明解析已经成功了。</p>
<figure>
<img src="http://img.xiajibagao.top/20200604141630.png" alt="image-20200604132815077"><figcaption aria-hidden="true">image-20200604132815077</figcaption>
</figure>
<p>回到存储仓库，此时外链域名可以选自己添加的二级域名了，切换到二级域名，然后保存为默认域名，之后引用的图片外链就会变成<code>二级域名/图片文件名</code>的格式了</p>
<h2 id="三-下载并安装picgo">三、下载并安装PicGo</h2>
<p>现在图床基本可以使用了，但是为了能更方便的管理，最重要的是能跟Typora无缝衔接，我们还需要PicGo辅助，</p>
<p>PicGo<a target="_blank" rel="noopener" href="https://github.com/Molunerfinn/PicGo/tags">下载地址</a>，选择版本并且根据自己的操作系统选择对应的安装包即可。</p>
<p>安装好后打开界面是这样的：</p>
<figure>
<img src="http://img.xiajibagao.top/20200604141634.png" alt="image-20200604134354105"><figcaption aria-hidden="true">image-20200604134354105</figcaption>
</figure>
<p>选择图床设置里的七牛图床：</p>
<figure>
<img src="http://img.xiajibagao.top/20200604141636.png" alt="image-20200604132153288"><figcaption aria-hidden="true">image-20200604132153288</figcaption>
</figure>
<ul>
<li>设定AK和SK：前往七牛云个人中心 --》密匙管理复制黏贴即可</li>
<li>设定储存空间名：和七牛存储空间名称一致</li>
<li>设定访问网站：即你的二级域名，这里<strong>需要在域名之前加上http://</strong></li>
</ul>
<p>然后点确认保存设置，回到上传区选项即可上传图片到图床。</p>
<ul>
<li>上传图片成功后剪贴板会自动获取图片引用的外链</li>
<li>在相册可以查看通过PicGo上传过的图片</li>
</ul>
<p>然后我们需要打开Server：</p>
<figure>
<img src="http://img.xiajibagao.top/20200604141547.png" alt="image-20200604132637321"><figcaption aria-hidden="true">image-20200604132637321</figcaption>
</figure>
<figure>
<img src="http://img.xiajibagao.top/20200604140447.png" alt="image-20200604134431620"><figcaption aria-hidden="true">image-20200604134431620</figcaption>
</figure>
<p>开启端口监听后确认即可。</p>
<h2 id="四-typora配置图片上传">四、Typora配置图片上传</h2>
<h3 id="1配置上传服务设定">1.配置上传服务设定</h3>
<p>设置好PicGo后来到Typora进行配置：</p>
<figure>
<img src="http://img.xiajibagao.top/20200604140448.png" alt="image-20200604134151633"><figcaption aria-hidden="true">image-20200604134151633</figcaption>
</figure>
<p>打开偏好设置 --》图像 --》 上传服务设定</p>
<ul>
<li>上传服务：选择PicGo</li>
<li>PicGo路径：选择PicGo安装根目录的.exe文件</li>
</ul>
<h3 id="2上传图片">2.上传图片</h3>
<p>上传图片有三种方式：</p>
<ul>
<li><p>加入图片时直接上传</p>
<p>在偏好设置 --》图像 --》插入图片时 设置</p></li>
<li><p>对图片右键上传</p></li>
<li><p>在格式 --》图像 --》 上传所有本地图片</p></li>
</ul>
<p>如果出现报错，一般是端口被占用，可以打开PicGo的server看看端口是否还是36677，改变了的话改回来就好了。</p>
<p>如果还出现其他报错，可以参考这篇文章：</p>
<p><a target="_blank" rel="noopener" href="https://www.jianshu.com/p/4cd14d4ceb1d">手把手教你用Typora自动上传到picgo图床【教程与排坑】</a></p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/%E6%9D%82%E4%B8%83%E4%B9%B1%E5%85%AB/" rel="tag"># 杂七乱八</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2020/02/23/%E6%9D%82%E4%B8%83%E4%B9%B1%E5%85%AB/Springboot%E4%BD%BF%E7%94%A8swagger2%E7%94%9F%E6%88%90Api%E6%96%87%E6%A1%A3/" rel="next" title="Springboot使用swagger2生成Api文档">
                <i class="fa fa-chevron-left"></i> Springboot使用swagger2生成Api文档
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2020/06/14/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B8%8E%E7%AE%97%E6%B3%95%EF%BC%88%E4%B8%80%EF%BC%89%EF%BC%9A%E9%98%9F%E5%88%97/" rel="prev" title="数据结构与算法（一）：队列">
                数据结构与算法（一）：队列 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="/images/Createsequence.jpg"
                alt="" />
            
              <p class="site-author-name" itemprop="name"></p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/%7C%7Carchive">
              
                  <span class="site-state-item-count">89</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">15</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">21</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%A6%82%E8%BF%B0"><span class="nav-text">概述</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%80-%E5%88%9B%E5%BB%BA%E5%B9%B6%E4%B8%8A%E4%BC%A0%E6%96%87%E4%BB%B6%E5%88%B0%E5%AD%98%E5%82%A8%E7%A9%BA%E9%97%B4"><span class="nav-text">一、创建并上传文件到存储空间</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1%E6%B3%A8%E5%86%8C%E4%B8%83%E7%89%9B%E8%B4%A6%E5%8F%B7%E5%B9%B6%E4%B8%94%E5%AE%9E%E5%90%8D%E8%AE%A4%E8%AF%81"><span class="nav-text">1.注册七牛账号，并且实名认证</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2%E5%88%9B%E5%BB%BA%E5%82%A8%E5%AD%98%E7%A9%BA%E9%97%B4"><span class="nav-text">2.创建储存空间</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3%E4%B8%8A%E4%BC%A0%E6%96%87%E4%BB%B6"><span class="nav-text">3.上传文件</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%BA%8C-%E5%88%9B%E5%BB%BA%E4%BA%8C%E7%BA%A7%E5%9F%9F%E5%90%8D%E5%B9%B6%E8%A7%A3%E6%9E%90%E5%88%B0%E4%B8%83%E7%89%9B%E4%BA%91cname"><span class="nav-text">二、创建二级域名并解析到七牛云CNAME</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1%E8%AE%BE%E7%BD%AE%E5%AD%98%E5%82%A8%E7%A9%BA%E9%97%B4%E5%9F%9F%E5%90%8D%E7%BB%91%E5%AE%9A"><span class="nav-text">1.设置存储空间域名绑定</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2%E5%89%8D%E5%BE%80%E5%9F%9F%E5%90%8D%E6%9C%8D%E5%8A%A1%E5%95%86%E5%88%9B%E5%BB%BA%E4%BA%8C%E7%BA%A7%E5%9F%9F%E5%90%8D"><span class="nav-text">2.前往域名服务商创建二级域名</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3%E4%BD%BF%E7%94%A8%E4%BA%8C%E7%BA%A7%E5%9F%9F%E5%90%8D%E4%BB%A3%E6%9B%BF%E9%BB%98%E8%AE%A4%E6%B5%8B%E8%AF%95%E5%9F%9F%E5%90%8D"><span class="nav-text">3.使用二级域名代替默认测试域名</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%89-%E4%B8%8B%E8%BD%BD%E5%B9%B6%E5%AE%89%E8%A3%85picgo"><span class="nav-text">三、下载并安装PicGo</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%9B%9B-typora%E9%85%8D%E7%BD%AE%E5%9B%BE%E7%89%87%E4%B8%8A%E4%BC%A0"><span class="nav-text">四、Typora配置图片上传</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1%E9%85%8D%E7%BD%AE%E4%B8%8A%E4%BC%A0%E6%9C%8D%E5%8A%A1%E8%AE%BE%E5%AE%9A"><span class="nav-text">1.配置上传服务设定</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2%E4%B8%8A%E4%BC%A0%E5%9B%BE%E7%89%87"><span class="nav-text">2.上传图片</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Createsequence</span>

  
</div>






  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  

  

  
  

  

  

  


  <!-- 引入目录截取js -->
  <script type="text/javascript" src="/js/src/custom/custom.js"></script>
</body>
</html>
